CXX = u++					# compiler
CXXFLAGS = -g -Wall -Wno-unused-label -MMD # compiler flags
MAKEFILE_NAME = ${firstword ${MAKEFILE_LIST}}	# makefile name

OBJECTS1 = main.o config.o Bank.o Printer.o VendingMachine.o WATCardOffice.o WATCard.o Truck.o NameServer.o Parent.o Student.o BottlingPlant.o Global.o
EXEC1 = soda				# 1st executable name


OBJECTS = ${OBJECTS1}		# all object files
DEPENDS = ${OBJECTS:.o=.d}			# substitute ".o" with ".d"
EXECS = ${EXEC1}			# all executables

#############################################################

.PHONY : all clean

all : ${EXECS}					# build all executables

${EXEC1} : ${OBJECTS1}				# link step 1st executable
	${CXX} $^ -o $@


#############################################################

${OBJECTS} : ${MAKEFILE_NAME}			# OPTIONAL : changes to this file => recompile

-include ${DEPENDS}				# include *.d files containing program dependences

clean :						# remove files that can be regenerated
	rm -f *.d *.o ${EXECS} interference

